package gui;

import commandExecution.*;


import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableModel;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

public class Table extends JFrame{
	private boolean DEBUG = false;
    private ArrayList<String> l;
    protected Object[][] data;
    protected Object[] tableColumnNames = new Object[2];
    protected ArrayList<String> linea = CommandRunner.getOutput();
   
	
	public Table(){
		
		
		JTable table = new JTable(new MyTableModel());
        table.setPreferredScrollableViewportSize(new Dimension(500, 70));
        table.setFillsViewportHeight(true);
        
        setTitle("Java Searching Utility");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		getContentPane().setLayout(new GridLayout(1,0));
        
		data = new Object[linea.size()][2];

        //Create the scroll pane and add the table to it.
        JScrollPane scrollPane = new JScrollPane(table);
        scrollPane.setOpaque(true);

        //Add the scroll pane to this panel.
        this.add(scrollPane, BorderLayout.CENTER);
    }

    class MyTableModel extends AbstractTableModel {
    	
    	
    	//tableColumnNames[0] = "Nome";
    	//tableColumnNames[1] = "Salva";
    	
    	
    	
    	public MyTableModel(){
    		
    		tableColumnNames[0] = "Nome";
        	tableColumnNames[1] = "Salva";
        	
        
    		
    		
    	}

		@Override
		public int getColumnCount() {
			// TODO Auto-generated method stub
			return 0;
		}

		@Override
		public int getRowCount() {
			// TODO Auto-generated method stub
			return 0;
		}

		@Override
		public Object getValueAt(int arg0, int arg1) {
			// TODO Auto-generated method stub
			return null;
		}
		
    }

}
